package com.algebra.util.sensitive;

import cn.hutool.core.util.DesensitizedUtil;

import java.util.HashMap;
import java.util.function.Function;

/**
 * @author al
 * @date 2022/5/25 11:42
 * @description 具体脱敏策略实现
 */
public class SensitiveStrategyMap extends HashMap<String, Function<String, String>> {

    public SensitiveStrategyMap() {
        this.put("chineseName", DesensitizedUtil::chineseName);
        this.put("idCard", (var0) -> DesensitizedUtil.idCardNum(var0, 5, 2));
        this.put("mobile", DesensitizedUtil::mobilePhone);
        this.put("address", (var0) -> DesensitizedUtil.address(var0, 5));
        this.put("email", DesensitizedUtil::email);
        this.put("bankCard", DesensitizedUtil::bankCard);
    }
}
